package cn.itmtr.screenshot.service.impl;

import cn.hutool.core.util.StrUtil;
import cn.hutool.system.SystemUtil;
import cn.itmtr.screenshot.service.IScreenshotService;

/**
 * 网页截图windows实现
 *
 * @author mtr
 * @since 2021-09-24
 */
public class ScreenshotWindowsServiceImpl implements IScreenshotService {

    @Override
    public String getImageDefaultPath() {
        String currentDir = SystemUtil.getUserInfo().getHomeDir();
        return currentDir + "Desktop/" + System.currentTimeMillis() + ".png";
    }

    @Override
    public String getPhantomjsCmd() {
        String base = "C:/Users/AOC/Desktop/phantomjs-2.1.1-windows/";
        return StrUtil.format("{}{} {}{}", base, "bin/phantomjs.exe", base, "examples/rasterize.js");
    }

}
